home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 7 / Apprentice-Release7.iso / Source Code / PowerPlant / UGetMultipleFiles 1.4 / GetDirItems.h < prev    next >
Encoding:
Text File  |  1996-08-13  |  3.4 KB  |  102 lines  |  [TEXT/CWIE]

  1. // --------------------------------------------------------------------------------------------
  2. //    UGetMulltipleFiles - An Add Files utility class
  3. //        By David Hirsch
  4. // --------------------------------------------------------------------------------------------
  5.  
  6. // GetDirItems.h - taken from the following source, with changes.
  7.  
  8.     /*
  9.     **    Apple Macintosh Developer Technical Support
  10.     **
  11.     **    A collection of useful high-level File Manager routines.
  12.     **
  13.     **    by Jim Luther, Apple Developer Technical Support Emeritus
  14.     **
  15.     **    File:        MoreFilesExtras.h
  16.     **
  17.     **    Copyright © 1992-1996 Apple Computer, Inc.
  18.     **    All rights reserved.
  19.     **
  20.     **    You may incorporate this sample code into your applications without
  21.     **    restriction, though the sample code has been provided "AS IS" and the
  22.     **    responsibility for its operation is 100% yours.  However, what you are
  23.     **    not permitted to do is to redistribute the source as "DSC Sample Code"
  24.     **    after having made changes. If you're going to re-distribute the source,
  25.     **    we require that you make it clear in the source that the code was
  26.     **    descended from Apple Sample Code, but that you've made changes.
  27.     */
  28.  
  29.  
  30. #ifdef __cplusplus
  31. extern "C" {
  32. #endif
  33.  
  34.  
  35. #if PRAGMA_ALIGN_SUPPORTED
  36. #pragma options align=reset
  37. #endif
  38.  
  39. /*****************************************************************************/
  40.  
  41. pascal    OSErr    GetDirItems(short vRefNum,
  42.                             long dirID,
  43.                             StringPtr name,
  44.                             Boolean getFiles,
  45.                             Boolean getDirectories,
  46.                             FSSpecPtr items,
  47.                             short reqItemCount,
  48.                             short *actItemCount,
  49.                             short *itemIndex);
  50. /*    ¶ Return a list of items in a directory.
  51.     The GetDirItems function returns a list of items in the specified
  52.     directory in an array of FSSpec records. File, subdirectories, or
  53.     both can be returned in the list.
  54.     
  55.     A noErr result indicates that the items array was filled
  56.     (actItemCount == reqItemCount) and there may be additional items
  57.     left in the directory. A fnfErr result indicates that the end of
  58.     the directory list was found and actItemCount items were actually
  59.     found this time.
  60.  
  61.     vRefNum            input:    Volume specification.
  62.     dirID            input:    Directory ID.
  63.     name            input:    Pointer to object name, or nil when dirID
  64.                             specifies a directory that's the object.
  65.     getFiles        input:    Pass true to have files added to the items list.
  66.     getDirectories    input:    Pass true to have directories added to the
  67.                             items list.
  68.     items            input:    Pointer to array of FSSpec where the item list
  69.                             is returned.
  70.     reqItemCount    input:    Maximum number of items to return (the number
  71.                             of elements in the items array).
  72.     actItemCount    output: The number of items actually returned.
  73.     itemIndex        input:    The current item index position. Set to 1 to
  74.                             start with the first item in the directory.
  75.                     output:    The item index position to get the next item.
  76.                             Pass this value the next time you call
  77.                             GetDirItems to start where you left off.
  78.     
  79.     Result Codes
  80.         noErr                0        No error, but there are more items
  81.                                     to list
  82.         nsvErr                -35        No such volume
  83.         ioErr                -36        I/O error
  84.         bdNamErr            -37        Bad filename
  85.         fnfErr                -43        File not found, there are no more items
  86.                                     to be listed.
  87.         paramErr            -50        No default volume or itemIndex was <= 0
  88.         dirNFErr            -120    Directory not found or incomplete pathname
  89.         afpAccessDenied        -5000    User does not have the correct access
  90.         afpObjectTypeErr    -5025    Directory not found or incomplete pathname
  91. */
  92.  
  93.  
  94.  
  95. #ifdef __cplusplus
  96. }
  97. #endif
  98.  
  99. #ifndef __COMPILINGMOREFILES
  100. #undef pascal
  101. #endif
  102.